﻿using System;
using System.Collections.Generic;
using System.ServiceModel;
using System.Runtime.Serialization;

namespace TCKQKL.Service.DataContract
{
    /// <summary>
    /// Markets  summary information
    /// </summary>
    [DataContract]
    public sealed class MarketSummaryDataModel
    {
        private string _marketName; 
        private decimal _index;
        private decimal _changed;
        private decimal _totalTrade;
        private decimal _totalShare;
        private decimal _totalValue;        
        private List<StocksDataModel> _topGainers;
        private List<StocksDataModel> _topLosers;
        private List<StocksDataModel> _topActives;
        private List<StocksDataModel> _topForeignBuy;
        private List<StocksDataModel> _topForeignSell;
        private List<StocksDataModel> _topNegotiatedTrade;
        private DateTime _summaryDate;
        private string _marketStatus;

        public MarketSummaryDataModel()
        {
        }

        public MarketSummaryDataModel(string marketName, decimal index, decimal Changed, decimal totalTrade, decimal totalShare, decimal totalValue, List<StocksDataModel> topGainers, List<StocksDataModel> topLosers, List<StocksDataModel> topActives, List<StocksDataModel> topForeignBuy, List<StocksDataModel> topForeignSell, List<StocksDataModel> topNegotiatedTrade, DateTime summaryDate, string marketStatus)
        {
            this._marketName = marketName;
            this._index = index;
            this._changed = Changed;
            this._totalTrade = totalTrade;
            this._totalShare = totalShare;
            this._totalValue = totalValue;
            this._topGainers = topGainers;
            this._topLosers = topLosers;
            this._topActives = topActives;
            this._topForeignBuy = topForeignBuy;
            this._topForeignSell = topForeignSell;
            this._topNegotiatedTrade = topNegotiatedTrade;
            this._summaryDate = DateTime.Now;
            this._marketStatus = marketStatus;
        }


        [System.Xml.Serialization.XmlElementAttribute(ElementName = "marketName", Order = 1, IsNullable = false)]
        [DataMember(IsRequired = false, Name = "marketName", Order = 1)]
        public string marketName
        {
            get
            {
                return _marketName;
            }

            set
            {
                this._marketName = value;
            }

        }

        [System.Xml.Serialization.XmlElementAttribute(ElementName = "index", Order = 2, IsNullable = false)]
        [DataMember(IsRequired = false, Name = "index", Order = 2)]
        public decimal index
        {
            get
            {
                return _index;
            }
            set { _index = value; }
        }

        [System.Xml.Serialization.XmlElementAttribute(ElementName = "Changed", Order = 3, IsNullable = false)]
        [DataMember(IsRequired = false, Name = "Changed", Order = 3)]

        public decimal Changed
        {
            get { return _changed; }
            set { _changed = value; }
        }

        [System.Xml.Serialization.XmlElementAttribute(ElementName = "totalTrade", Order = 4, IsNullable = false)]
        [DataMember(IsRequired = false, Name = "totalTrade", Order = 4)]
        public decimal totalTrade
        {
            get
            {
                return _totalTrade;
            }
            set { _totalTrade = value; }
        }

        [System.Xml.Serialization.XmlElementAttribute(ElementName = "totalShare", Order = 5, IsNullable = false)]
        [DataMember(IsRequired = false, Name = "totalShare", Order = 5)]
        public decimal totalShare
        {
            get
            {
                return _totalShare;
            }
            set { _totalShare = value; }
        }

        [System.Xml.Serialization.XmlElementAttribute(ElementName = "totalValue", Order = 6, IsNullable = false)]
        [DataMember(IsRequired = false, Name = "totalValue", Order = 6)]
        public decimal totalValue
        {
            get
            {
                return _totalValue;
            }
            set { _totalValue = value; }
        }

        [System.Xml.Serialization.XmlArray(ElementName = "topGainers", Order = 7, IsNullable = false), System.Xml.Serialization.XmlArrayItem(typeof(StocksDataModel))]
        [DataMember(EmitDefaultValue = false, IsRequired = false, Name = "topGainers", Order = 7)]
        public List<StocksDataModel> topGainers
        {
            get
            {
                return _topGainers;
            }

            set
            {
                this._topGainers = value;
            }

        }

        [System.Xml.Serialization.XmlArray(ElementName = "topLosers", Order = 8, IsNullable = false), System.Xml.Serialization.XmlArrayItem(typeof(StocksDataModel))]
        [DataMember(EmitDefaultValue = false, IsRequired = false, Name = "topLosers", Order = 8)]
        public List<StocksDataModel> topLosers
        {
            get
            {
                return _topLosers;
            }

            set
            {
                this._topLosers = value;
            }

        }

        [System.Xml.Serialization.XmlArray(ElementName = "topActives", Order = 9, IsNullable = false), System.Xml.Serialization.XmlArrayItem(typeof(StocksDataModel))]
        [DataMember(EmitDefaultValue = false, IsRequired = false, Name = "topActives", Order = 9)]
        public List<StocksDataModel> topActives
        {
            get
            {
                return _topActives;
            }

            set
            {
                this._topActives = value;
            }

        }

        [System.Xml.Serialization.XmlArray(ElementName = "topForeignBuy", Order = 10, IsNullable = false), System.Xml.Serialization.XmlArrayItem(typeof(StocksDataModel))]
        [DataMember(EmitDefaultValue = false, IsRequired = false, Name = "topForeignBuy", Order = 10)]
        public List<StocksDataModel> topForeignBuy
        {
            get
            {
                return _topForeignBuy;
            }

            set
            {
                this._topForeignBuy = value;
            }

        }

        [System.Xml.Serialization.XmlArray(ElementName = "topForeignSell", Order = 11, IsNullable = false), System.Xml.Serialization.XmlArrayItem(typeof(StocksDataModel))]
        [DataMember(EmitDefaultValue = false, IsRequired = false, Name = "topForeignSell", Order = 11)]
        public List<StocksDataModel> topForeignSell
        {
            get
            {
                return _topForeignSell;
            }

            set
            {
                this._topForeignSell = value;
            }

        }

        [System.Xml.Serialization.XmlArray(ElementName = "topNegotiatedTrade", Order = 12, IsNullable = false), System.Xml.Serialization.XmlArrayItem(typeof(StocksDataModel))]
        [DataMember(EmitDefaultValue = false, IsRequired = false, Name = "topNegotiatedTrade", Order = 12)]
        public List<StocksDataModel> topNegotiatedTrade
        {
            get
            {
                return _topNegotiatedTrade;
            }

            set
            {
                this._topNegotiatedTrade = value;
            }

        }

        [System.Xml.Serialization.XmlElementAttribute(ElementName = "summaryDate", Order = 13, IsNullable = false)]
        [DataMember(IsRequired = false, Name = "summaryDate", Order = 13)]
        public DateTime summaryDate
        {
            get
            {
                return _summaryDate;
            }

            set
            {
                this._summaryDate = value;
            }
        }

        [System.Xml.Serialization.XmlElementAttribute(ElementName = "MarketStatus", Order = 14, IsNullable = false)]
        [DataMember(IsRequired = false, Name = "MarketStatus", Order = 14)]
        public string MarketStatus
        {
            get { return _marketStatus; }
            set { _marketStatus = value; }
        }

    }
}